<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

Route::group(['domain' => 'www.laravel.com'], function () {

    Route::group(['middleware' => 'auth:web'], function () {
        // 创建文章
        Route::get('/create', '\App\Http\Controllers\BlogController@create');

        // 创建文章逻辑
        Route::post('/add', '\App\Http\Controllers\BlogController@add');

        // 上传文章
        Route::post('/upload', '\App\Http\Controllers\BlogController@upload');

        // 文章修改
        Route::get('/edit/{info}', '\App\Http\Controllers\BlogController@edit');

        // 文章修改逻辑
        Route::post('/update/{info}', '\App\Http\Controllers\BlogController@update');

        // 删除文章
        Route::get('/delete/{info}', '\App\Http\Controllers\BlogController@delete');
        // 登出
        Route::get('/logout', '\App\Http\Controllers\UserController@logout');
    });


// 文章列表页面
    Route::get('/', '\App\Http\Controllers\BlogController@index');
    Route::get('/index', '\App\Http\Controllers\BlogController@index');

// 文章详情
    Route::get('/info/{info}', '\App\Http\Controllers\BlogController@info');


// 用户模块

// 登录页面
    Route::get('/login', '\App\Http\Controllers\UserController@login')->name('login');
// 登录逻辑
    Route::post('/login', '\App\Http\Controllers\UserController@loginStore');

// 注册页面
    Route::get('/register', '\App\Http\Controllers\UserController@register');

// 注册逻辑
    Route::post('/register', '\App\Http\Controllers\UserController@registerStore');
});

Route::group(['domain' => 'admin.laravel.com'], function () {
//    Route::group(['prefix' => 'admin'], function () { });

    Route::get('/index', '\App\Admin\Controllers\IndexController@index');

});








